
import Debug.QuickCheck

-- the current exchange rate for euros vs. seks
euroRate :: Double
euroRate = 9.132143

-- converts euros to sek
sek :: Double -> Double
sek e = e * euroRate

-- converts sek to euros
euro :: Double -> Double
euro s = s / euroRate

-- euro is the inverse of sek
prop_EuroSek :: Double -> Bool
prop_EuroSek e = euro (sek e) ~== e

-- almost equal
(~==) :: Double -> Double -> Bool
x ~== y = abs (x-y) < 0.00001

